﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using Wangzeran.CodeMaker.Core.Model;

namespace Wangzeran.CodeMaker.Core.Template
{
    /// <summary>
    /// 模板文件集合
    /// </summary>
    public class TemplateFiles
    {
        /// <summary>
        /// 已注册标签
        /// </summary>
        private static IDictionary<string, IList<TemplateFileModal>> m_Files = 
            new Dictionary<string, IList<TemplateFileModal>>();
        /// <summary>
        /// 已注册标签
        /// </summary>
        public static IDictionary<string, IList<TemplateFileModal>> Files
        {
            get { return m_Files; }
            set { m_Files = value; }
        }

        /// <summary>
        /// 注册模板文件
        /// </summary>
        /// <param name="modal">模板实体</param>
        public static void RegisterTemplateFile(TemplateFileModal modal)
        {
            if (!m_Files.ContainsKey(modal.Language))
            {
                IList<TemplateFileModal> lstFiles = new List<TemplateFileModal>();
                m_Files.Add(modal.Language, lstFiles);
            }
            m_Files[modal.Language].Add(modal);
        }
    }
}
